package com.scraper.dao.hibernate;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.scraper.dao.CityDAO;
import com.scraper.model.City;

public class CityDAOImpl extends BaseDAOImpl<City> implements CityDAO {

	public CityDAOImpl() {
		super(City.class);
	}

	public City getByName(String name) {
		Criteria criteria = getSession().createCriteria(entityClass);
		criteria.add(Restrictions.eq("name", name));
		return (City) criteria.uniqueResult();
	}

}
